﻿using System;
using System.Collections.Generic;
using System.Text;

namespace hedefgrup.reports.common
{
    public class TreeXPathSegment
    {
        public string Key;
        public string Type;
        public string Attribute;
        public string AttributeValue;

        public bool Test(Tree tree)
        {
            if (Key == "*" || tree.Key == Key)
            {
                if (Attribute == null || (tree[Attribute] == AttributeValue))
                {
                    if (Type == null || tree.Type == Type)
                    {
                        return true;
                    }
                }
            }
            return false;
        }
    }
}
